Run a script automatically after an Object is updated

I have run a script that runs when I execute it manually. Can anyone please tell me how I can automatically run this script when I update an Object in the module?
Thanks for any help.
SystemAdmin - Sun Feb 24 17:34:09 EST 2013

Re: Run a script automatically after an Object is updated
kbmurphy - Sun Feb 24 18:02:32 EST 2013

Look up triggers in the DXL Reference Manual.

Re: Run a script automatically after an Object is updated
llandale - Tue Feb 26 15:27:22 EST 2013

You will want a post-attr-save trigger. Good luck, but this may get you started.

Trigger    trg = current;           if (null trg)       halt()  // Error?
AttrDef ad  = attrdef(trg); if (null ad)        halt()  // Error?
Object  obj = object(trg);  if (null obj)       halt()  // Error?
Module  mod = module(obj);  if (null mod)       halt()  // Error?
string  ValuChanged     = value(trg)   // ?Perhaps this doesn't work?
string  Name = ad.name
if (I don't care about changes to Name) //
then halt
else I can see that obj.Name just got the value ValuChanged, other code goes here


Look through the forum for examples of DXL that will Deploy this trigger.

-Louie

Re: Run a script automatically after an Object is updated
SystemAdmin - Wed Feb 27 02:59:09 EST 2013

If you are really a newbie, take some time to plan, realize and test this. This script will run every time when someone does this thing. That means that you should have an overview that {b}anyone{b} who changes this object, will have this runnig script in the background. And if you have 1.000 Objects in a module you will create 1.000 errors (and perhaps error messages), not one. This may have some effects to the blood preasure and adrenalin levels of you colleges?